package deep1jvmdvm;

import utils.PrintlnUtils;

/*
StackOverflowError 栈溢出异常
递归调用是造成StackOverflowError的一个常见场景，比如以下代码：

 */
public class StackOver {
    private int number;

    public static void main(String[] args) {
        StackOver stackOver = new StackOver();
        try {
            stackOver.method();
        } catch (StackOverflowError e) {
            PrintlnUtils.println("栈容量已溢出!");
        }
    }

    public void method() {
        number++;
        method();
    }

}
